Skip to content

#19461 Rework Shout Preferences#19464

Open
belaroesener wants to merge 19 commits into
pharo-project:Pharo14from
belaroesener:improvement/rework-shout-preferences
Open

#19461 Rework Shout Preferences#19464
belaroesener wants to merge 19 commits into
pharo-project:Pharo14from
belaroesener:improvement/rework-shout-preferences

Conversation

@belaroesener

Copy link
Copy Markdown
Contributor

I reorganized the Shout Preferences around the predefined styles already available, adding two special styles Custom and Default.
Default represents the style for the currently selected UI Theme and will change if the UI Theme changes.
Custom represents the style editable via the SettingBrowser and can be initialized by copying it from any of the other styles.

I fixed the problems described in #19461:

  • With the new system, when loading a UI Theme, the current style is only changed to the Theme default, if the currently selected style is Default
  • I send #themeChanged to the world whenever any of the style elements is changed in the SettingBrowser. This works but I would be happy for any suggestions to make it work better, as this solution seems somewhat inefficient.
  • I replaced SHStyleElement with two new classes, that manage the state in a different way, and do not exhibit the same problems.
  • The emphasis bold italic now works

- Reorganize the syntax highlighting settings around the predefined styles
- Create two new predefined styles `Custom` and `Default` with special behaviour
- Modify logic for switching the UITheme so that changing it only switches the style if the current style is `Default`
- Fix emphasis `bold italic` 
- Make open code editors reflect changes to the `Custom` style directly
- Reorganize the inner workings of `SHPreferences`
- Replace `SHStyleElement` with `SHCustomStyle` and `SHCustomStyleElement`
- Remove unused methods from `SHPreferences class`
- Remove obsolete comments and todos
- Add descriptions for settings
- Fix formatting
@jecisc

jecisc commented Mar 25, 2026

Copy link
Copy Markdown
Member

@demarey and @estebanlm are currently working on the SettingBrowser.

Maybe they can be interested to review this PR

@estebanlm

Copy link
Copy Markdown
Member

is this working in the context of the new settings browser ?

Comment thread src/Shout/SHCustomStyle.class.st Outdated
SHCustomStyle class >> color: aColor forGroup: aGroupName [

(groups at: aGroupName) at: #color put: aColor.
SHPreferences cutomStyleChanged

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like a typo

@Ducasse

Ducasse commented Mar 25, 2026

Copy link
Copy Markdown
Member

Hi belaroesener

If you have some cycles for another PR after we integrate this one.
I would love to see all the symbols used in all Shout turned into strings because these symbols are unnecessary and polutes de symbol space.
This is on my todo but it is kind of infinite in this moment.

Tx

@belaroesener

Copy link
Copy Markdown
Contributor Author

is this working in the context of the new settings browser ?

This PR addresses the Issues I had with the old settings browser. I had not followed the development of the new setting browser, but now I am realizing that it is the default Browser in Pharo14? (I always use CMD-, to open the settings browser, but this still opens the old browser).

The style elements use special widgets, from my understanding the logic used by the new browser is a bit different for this. I'll look into it

@belaroesener

Copy link
Copy Markdown
Contributor Author

Hi belaroesener

If you have some cycles for another PR after we integrate this one. I would love to see all the symbols used in all Shout turned into strings because these symbols are unnecessary and polutes de symbol space. This is on my todo but it is kind of infinite in this moment.

Tx

Sure, could you elaborate a bit on what symbols you mean?

@jecisc

jecisc commented Mar 26, 2026

Copy link
Copy Markdown
Member

I think he is refering to the methods with the pragma #styleTable:

For example:

^ #(
			(default 								('657A81' muchDarker))
			...
)

This will create symbols. He would like it to become

^ #(
			('default' 								('657A81' muchDarker))
			...
)

This is what I understood. Maybe Steph can confirm

@Ducasse

Ducasse commented Apr 3, 2026

Copy link
Copy Markdown
Member

Yes I refered to this list of symbols.

@Ducasse

Ducasse commented Apr 7, 2026

Copy link
Copy Markdown
Member

Hello did you see my comment? cutom has a typo.

@belaroesener

Copy link
Copy Markdown
Contributor Author

@Ducasse Yes, it's a typo. Thanks, I'll fix it.

@Ducasse

Ducasse commented Apr 11, 2026

Copy link
Copy Markdown
Member

Thanks. Can you check the conflict?

@Ducasse

Ducasse commented May 5, 2026

Copy link
Copy Markdown
Member

Tx I will integrate it now.
My remark about symbol use is still valid.
We should minimize the use of Symbol.

@Ducasse Ducasse closed this May 5, 2026
@Ducasse Ducasse reopened this May 5, 2026
@Ducasse

Ducasse commented May 5, 2026

Copy link
Copy Markdown
Member

I do not get why the build is not working so I trigger a rebuild and we will have look at the build.

Rename `SHCustomStyleElement` to `SHStyleElement` (the class it replaced) to fix dependency of Pharo-NewTools.
@belaroesener

Copy link
Copy Markdown
Contributor Author

We should minimize the use of Symbol.

I'm looking into it now.

@Ducasse

Ducasse commented May 8, 2026

Copy link
Copy Markdown
Member

Excellent. Basically I was analyze the use of symbols and it seems that it does not use an identity based structure, so it means that using strings for keys is just enough.

@Ducasse

Ducasse commented May 8, 2026

Copy link
Copy Markdown
Member

The changes are looking ok to me. Let me know when I can integrate.

@Ducasse

Ducasse commented May 9, 2026

Copy link
Copy Markdown
Member

@belaroesener
did you see also #19654

…onary` internally.

(This will make the transition from symbols to strings easier)
@belaroesener

Copy link
Copy Markdown
Contributor Author

@belaroesener did you see also #19654

@Ducasse I looked at it, but I can not reproduce it. It does not sound like it has anything to do with Shout.

My code should be ready to integrate now

@Ducasse

Ducasse commented May 12, 2026

Copy link
Copy Markdown
Member

Thanks a lot!

@Ducasse Ducasse closed this May 19, 2026
@Ducasse Ducasse reopened this May 19, 2026
@Ducasse

Ducasse commented May 19, 2026

Copy link
Copy Markdown
Member

I;m sorry that we do not integrate it before but we got many regression.
I'm relaucnhing the build to get a fresh view and I would like to push this into pharo.

@Ducasse

Ducasse commented Jun 3, 2026

Copy link
Copy Markdown
Member

I see that

[Shout.Tests.SHStyleElementTest.testPrintOn](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-19464/10/testReport/junit/MacOSX64.Tests-osx-64.Shout.Tests/SHStyleElementTest/osx_64___Tests_osx_64___testPrintOn/)
[Shout.Tests.SHStyleElementTest.testStyleForTable](https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%20and%20branch%20Pipeline/job/PR-19464/10/testReport/junit/MacOSX64.Tests-osx-64.Shout.Tests/SHStyleElementTest/osx_64___Tests_osx_64___testStyleForTable/)

are broken

@belaroesener

Copy link
Copy Markdown
Contributor Author

Sorry, that was an obvious oversight on my part. Looking at the tests, they are not relevant to the new implementation. I'll just delete them then?

@Ducasse

Ducasse commented Jun 17, 2026

Copy link
Copy Markdown
Member

I think that two tests are failing that are related to the Pr

testStoreAndLoadAllSystemSettings
Windows64.Tests-windows-64.System.Settings.Tests.SystemSettingsPersistenceTest
7 0.29 sec
Error Details
Got Dictionary instead of SHStyleElement.
Stack Trace

TestFailure
Got Dictionary instead of SHStyleElement.
SystemSettingsPersistenceTest(TestAsserter)>>assert:description:resumable:
SystemSettingsPersistenceTest(TestAsserter)>>assert:description:
SystemSettingsPersistenceTest(TestAsserter)>>assert:equals:
[ ] in SystemSettingsPersistenceTest>>testStoreAndLoadAllSystemSettings
Array(SequenceableCollection)>>do:
SystemSettingsPersistenceTest>>testStoreAndLoadAllSystemSettings
SystemSettingsPersistenceTest(TestCase)>>performTest

and

TestFailure
the following classes have unused instance variables and should be cleaned: an OrderedCollection(SHPreferences class)
NoUnusedVariablesLeftTest(TestAsserter)>>assert:description:resumable:
NoUnusedVariablesLeftTest(TestAsserter)>>assert:description:
NoUnusedVariablesLeftTest>>testNoUnusedInstanceVariablesLeft
NoUnusedVariablesLeftTest(TestCase)>>performTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants